package com.pig.controller;

import com.pig.pojo.ImageVo;
import com.pig.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/upload")
public class FileController {

    @Autowired
    @Qualifier("fileServiceImpl")
    private FileService service;

    @RequestMapping("/file")
    public ImageVo file(MultipartFile myFile, Integer categoryId) {
        return service.upload(myFile,categoryId);
    }
}
